const state = {
    tabIndex:0,
    isAdd:false,
    tabList: [
        {
            iconPath: "/static/img/tabIcon/home.png",
            selectedIconPath: "/static/img/tabIcon/home-s.png",
            text: '首页',
            isDot: false,
            customIcon: true,
            midButton: false,
        },
        {
            iconPath: "/static/img/tabIcon/mine.png",
            selectedIconPath: "/static/img/tabIcon/mine-s.png",
            text: '我的',
            isDot: false,
            customIcon: true,
            midButton: false,
        },
    ],
    tabListRol: [
        {
            iconPath: "/static/img/tabIcon/home.png",
            selectedIconPath: "/static/img/tabIcon/home-s.png",
            text: '首页',
            isDot: false,
            customIcon: true,
            midButton: false,
        },
        {
            iconPath: "/static/img/tabIcon/work.png",
            selectedIconPath: "/static/img/tabIcon/work-s.png",
            text: '工作台',
            isDot: false,
            customIcon: true,
            midButton: false,
        },
        {
            iconPath: "/static/img/tabIcon/mine.png",
            selectedIconPath: "/static/img/tabIcon/mine-s.png",
            text: '我的',
            isDot: false,
            customIcon: true,
            midButton: false,
        },
    ]
}

const mutations = {
    setTabbarList: (state, repairInfo) => {
        state.tabList = repairInfo
    },
    addWorkTab:(state)=>{
        let tabObj={
            iconPath: "/static/img/tabIcon/work.png",
            selectedIconPath: "/static/img/tabIcon/work-s.png",
            text: '工作台',
            isDot: false,
            customIcon: true,
            midButton: false,
        }
        state.tabList.splice(1,0,tabObj)
    },
    delWorkTab:(state)=>{
        state.tabList.splice(1,1)
    },
    changeTabIndex:(state,index)=>{
        state.tabIndex=index
    }
}

const actions = {

}

const getters={
    getTabbarList:(state)=>{
        return state.tabList
    },
    getTabIndex:(state)=>{
        return state.tabIndex
    }
}

export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters
}
